# -*- coding:utf-8 -*-
from PySide6.QtWidgets import (QHBoxLayout, QLineEdit, QPushButton, QGroupBox)

class ProtocGroup(QGroupBox):
    def __init__(self):
        """
        protoc 命令所在路径文件路径设置
        """
        super().__init__("Protoc路径设置")
        # 水平布局
        protoc_layout = QHBoxLayout()
        self.protoc_path_input = QLineEdit()
        self.protoc_path_input.setPlaceholderText("Protoc命令所在目录...")
        self.protoc_path_input.setReadOnly(True)
        protoc_layout.addWidget(self.protoc_path_input, 7)

        self.protoc_btn_choose = QPushButton("选择目录")
        protoc_layout.addWidget(self.protoc_btn_choose)
        self.setLayout(protoc_layout)
    
    def set_language(self, lang_data):
        """设置语言"""
        self.setTitle(lang_data.get("protoc_title", "Protoc路径设置"))
        self.protoc_btn_choose.setText(lang_data.get("select_dir", "选择目录"))
        self.protoc_path_input.setPlaceholderText(lang_data.get("protoc_path_placeholder", "Protoc命令所在目录..."))
        